﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing.util {
    import flash.display.*;
    import flash.utils.*;
    import flash.system.*;

    public class Reflection {

        public static function createDisplayObjectInstance(_arg1:String, _arg2:ApplicationDomain=null):DisplayObject{
            return ((createInstance(_arg1, _arg2) as DisplayObject));
        }
        public static function createInstance(_arg1:String, _arg2:ApplicationDomain=null){
            var _local3:Class = getClass(_arg1, _arg2);
            if (_local3 != null){
                return (new (_local3)());
            };
            return (null);
        }
        public static function getClass(_arg1:String, _arg2:ApplicationDomain=null):Class{
            if (_arg2 == null){
                _arg2 = ApplicationDomain.currentDomain;
            };
            var _local3:Class = (_arg2.getDefinition(_arg1) as Class);
            return (_local3);
        }
        public static function getFullClassName(_arg1):String{
            return (getQualifiedClassName(_arg1));
        }
        public static function getClassName(_arg1):String{
            var _local2:String = getFullClassName(_arg1);
            var _local3:int = _local2.lastIndexOf(".");
            if (_local3 >= 0){
                _local2 = _local2.substr((_local3 + 1));
            };
            return (_local2);
        }
        public static function getPackageName(_arg1):String{
            var _local2:String = getFullClassName(_arg1);
            var _local3:int = _local2.lastIndexOf(".");
            if (_local3 >= 0){
                return (_local2.substring(0, _local3));
            };
            return ("");
        }

    }
}//package org.aswing.util 
